import {Component, ViewChild, AfterViewInit} from "@angular/core";
@Component({
  template:`
    <div style="overflow:hidden;height:100%;display:flex;flex-direction:column">
      <weui-swiper [options]="options" #swiper>
          <div class="swiper-container">
              <!-- 容器（必选） -->
              <div class="swiper-wrapper">
                  <div class="swiper-slide">
                      <img  src="../assets/credential.jpeg">
                  </div>
                  <div class="swiper-slide">
                      <img src="../assets/books.jpeg">
                  </div>
              </div>
              <!-- 分页（可选） -->
              <div class="swiper-pagination"></div>
          </div>
      </weui-swiper>
      <div style="flex-grow:1;overflow:auto;touch-action: pan-y;">
        <div class="panel">
        <div class="panel-header">课程内容</div>
        <div class="panel-body">
          <ul>
            <li>《初级会计实务》</li>
            <li>《经济法基础》</li>
           </ul>
        </div>
      </div>
      <div class="panel">
        <div class="panel-header">收费标准</div>
        <div class="panel-body">
          2800元（含教材和教辅）
        </div>
      </div>
      <div class="panel">
        <div class="panel-header">学习时长</div>
        <div class="panel-body">
          3个月
        </div>
      </div>
      <div class="panel">
        <div class="panel-header">报名条件</div>
        <div class="panel-body">
          高中、中专或技校以上学历，无年龄限制
        </div>
      </div>
      <div class="panel">
        <div class="panel-header">考试介绍</div>
        <div class="panel-body">
          <ul>
            <li>国家统一考试，每年11月初报名，次年5月中旬考试</li>
            <li>单次考试两门成绩均在60分以上合格</li>
          </ul>
        </div>
      </div>
      </div>
    </div>
  `,
  styles:[
    `
      :host{
        overflow:hidden
      }
      img{
        width:100vw;
        height:50vw;
      }
    `
  ]
})
export class SeniorAccountingComponent implements AfterViewInit{
  options={
    autoplay: {
      delay: 2000,
      allowTouchMove:false
    },
  };
  @ViewChild("swiper") swiper;

  ngAfterViewInit(): void {
    console.log(this.swiper);
    this.swiper.swiper.allowTouchMove=false;
  }
}
